#include "stdafx.h"
#include "CppUnitTest.h"
#include "..\XoLibCPP32\KeyboardSimulator.h"
#include "..\XoLibCPP32\VirtualKeyCode.h"


using namespace Microsoft::VisualStudio::CppUnitTestFramework;

namespace XoLibCPPTest
{		
	TEST_CLASS(UnitTest1)
	{
	public:
		
		TEST_METHOD(TestMethod1)
		{
			// TODO: Ici, votre code de test
		}

     
        TEST_METHOD(OpenWindowsExplorer) 
        {
            CKeyboardSimulator sim;
            sim.ModifiedKeyStroke(VirtualKeyCode::LWIN, VirtualKeyCode::VK_E);
        }

       TEST_METHOD(SayHello) 
        {
            CKeyboardSimulator sim;
            sim.ModifiedKeyStroke(VirtualKeyCode::LWIN, VirtualKeyCode::VK_R);
            _sleep(1000);
            sim.TextEntry(L"notepad");
            _sleep(1000);
            sim.KeyPress(VirtualKeyCode::RETURN);
            _sleep(1000);
            sim.TextEntry(L"These are your orders if you choose to accept them...");
            sim.TextEntry(L"This message will self destruct in 5 seconds.");
            _sleep(5000);
            sim.ModifiedKeyStroke(VirtualKeyCode::MENU, VirtualKeyCode::SPACE);
            sim.KeyPress(VirtualKeyCode::DOWN);
            sim.KeyPress(VirtualKeyCode::RETURN);
            int i = 50;
            while (i-- > 0) sim.KeyPress(VirtualKeyCode::DOWN);
            sim.KeyPress(VirtualKeyCode::RETURN);
            _sleep(1000);
            sim.ModifiedKeyStroke(VirtualKeyCode::MENU, VirtualKeyCode::F4);
            sim.KeyPress(VirtualKeyCode::VK_N);
        }

	   /*
	    TEST_METHOD(Paint) 
        {
	     // Paint
			CKeyboardSimulator sim;			
            sim.Mouse.LeftButtonDown();
            sim.Mouse.MoveMouseToPositionOnVirtualDesktop(65535/2, 65535/2);
            sim.Mouse.LeftButtonUp();

		}
		*/
	};
}